//
//  SEGDoorListViewModel.h
//  Commom
//
//  Created by Clavis on 2020/6/9.
//

#import <Foundation/Foundation.h>
#import <SEGModel/SEGNewMyDoorListModel.h>
#import <ReactiveObjC/ReactiveObjC.h>

@interface SEGDoorListViewModel : NSObject

#pragma mark - 门禁列表
/// 提交开门记录（蓝牙门）
- (void)submitOpenDoorHistory;

/// 获取本地门禁列表
- (NSArray<SEGNewMyDoorListModel *> *)getLocalAllDoorList;

/// 获取网络门禁列表
- (RACSignal *)requestNetAllDoorList;

/// 保存排序之后的门禁列表
/// @param sortDoorList sortDoorList
- (void)saveSortDoorList:(NSArray<SEGNewMyDoorListModel *> *)sortDoorList;

#pragma mark - 门禁组件
/// 获取门禁组件数据（先返回本地数据 再返回网络数据)
/// @param completedBlock completedBlock
- (void)requestDoorComponentList:(void(^)(NSArray<NSDictionary*>*))completedBlock;

#pragma mark - 常用门
/// 获取老的常用门
- (NSArray<SEGNewMyDoorListModel*> *)getOldCommonDoor;

// 更新老常用门
- (void)updateOldCommonDoors:(NSArray<SEGNewMyDoorListModel *> *)newCommonDoors;

#pragma mark - handle OneQrcodePass door
/// 获取一码通行门禁
- (SEGNewMyDoorListModel*)getOneQrcodePassDoor;

/// 获取除一码通行之外的门禁列表
- (NSArray<SEGNewMyDoorListModel*> *)getLocalAllDoorListExceptOneQrcodePassDoor;

@end

